package com.blyat.xsoft.auth.restful.service;

import com.blyat.xsoft.auth.restful.entity.Authority;
import com.blyat.xsoft.kernel.restful.pagination.PageList;
import com.blyat.xsoft.kernel.restful.service.BaseService;

import java.util.List;
import java.util.Map;

/**
 * @author syh
 * @date 2019/10/21
 **/
public interface AuthorityService extends BaseService<Authority> {

    /**
     * security 获取所有权限（未构建树）
     * @return
     */
    List<Authority> getAll();

    /**
     * security 获取所有用户权限（未构建树）
     * @param userId
     * @return
     */
    List<Authority> getByUserId(String userId);

    List<Authority> getByClientId(String clientId);

    /**
     * 构造用户权限树
     * @param userId
     * @return
     */
    List<Authority> getAuthorityTreeByUserId(String userId);

    /**
     * 构建后台菜单树
     * @param query
     * @return
     */
    PageList<Authority> findAllAuthTreeByPage(String query);

    List<Map<String, Object>> getAuthTree(String query);

    List<Map<String, Object>> buildSelectTree(String pid);
}
